/*
 * Copyright (c) 2023-2024 elsfs Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.elsfs.cloud.module.config.api.entity;

import cn.idev.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.elsfs.cloud.common.annotations.Spell;
import org.elsfs.cloud.common.core.entity.BaseSpellEntity;

/**
 * 系统配置
 *
 * @author zeng
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SysConfig extends BaseSpellEntity implements ConfigEntity {
  /** 配置ID */
  @TableId
  @ExcelProperty(value = "配置ID")
  @TableField(condition = SqlCondition.LIKE)
  @Schema(description = "配置ID")
  private String configId;

  /** 配置KEY */
  @NotBlank(message = "配置KEY不能为空")
  @ExcelProperty(value = "配置KEY")
  @Schema(description = "配置ID")
  @TableField(whereStrategy = FieldStrategy.NOT_EMPTY)
  private String configKey;

  /** 配置名称 */
  @NotBlank(message = "配置名称不能为空")
  @ExcelProperty(value = "配置名称")
  @TableField(condition = SqlCondition.LIKE, whereStrategy = FieldStrategy.NOT_EMPTY)
  @Spell
  private String configName;

  /** 配置值 */
  @NotBlank(message = "配置值不能为空")
  @ExcelProperty(value = "配置值")
  @Schema(description = "配置值")
  private String configValue;

  /** 配置类型 */
  @NotBlank(message = "配置类型不能为空")
  @ExcelProperty(value = "配置类型")
  @Schema(description = "配置类型")
  private String configType;

  /** 配置描述 */
  @ExcelProperty(value = "配置描述")
  @Schema(description = "配置描述")
  private String remark;
}
